import { FC, useEffect } from 'react';
import SimpleList from '@/components/SimpleList';
import { useModel } from 'umi';
import { copyrightType } from './config';
const columns: any[] = [
  {
    title: '商标名称',
    dataIndex: 'U001',
    width: 150,
  },
  {
    title: '申请日期',
    dataIndex: 'U002',
    width: 200,
  },
  {
    title: '国际分类',
    dataIndex: 'U003',
    width: 150,
    render: (data: any) => <span>{copyrightType[data.U003] || ''}</span>,
  },
  {
    title: '注册号',
    dataIndex: 'U004',
    width: 240,
  },
  {
    title: '状态',
    dataIndex: 'U005',
    width: 140,
  },
];

const TrademarkCopyright: FC = () => {
  const { trademark, getTrademark } = useModel('company');
  useEffect(() => {
    const id = window.sessionStorage.getItem('companyId') || '';
    getTrademark({ id });
  }, []);
  return (
    <SimpleList
      width={848}
      height={220}
      columns={columns}
      dataSource={trademark}
      headerStyle={{
        height: 42,
        backgroundColor: 'rgba(141, 141, 141, 0.1)',
      }}
      rowStyle={{
        height: 42,
      }}
      sortStyle={{
        width: 88,
      }}
      hover
      odd
      rowBackground
    />
  );
};
export default TrademarkCopyright;
